<?php
/*
    Id:     $Id: $
    File:   ProjectModel.php
    Author: John Griffin
    Date:   May 9, 2009

    Description:
*/
require_once 'lib/URLToSQL.php';

class ProjectModel {
	private $pdo = null;
	private $converter = null;
	private $error = null;
	
	public function __construct (PDO $pdo, SimpleXMLElement $resource, Error $error) {
		$this->pdo = $pdo;
		$this->converter = new URLToSQL ($resource);
		$this->error = $error;
	}
	
	public function insert (array $record) {
	    $return = -1;
	    $sql = $this->URLToSQL->buildInsert ($record);
	    if (count ($this->error) == 0) {
		    $statement = $this->pdo->prepare ($sql);
		    $statement->execute ($record);
		    $return = $this->pdo->lastInsertId ();
		}
		return $return;
	}
	
	public function update (array $record) {
	}
	
	public function delete (array $record) {
	}
	
	public function select (array $arguments, array $modifiers) {
	}
}
?>

